<style>
    .container {
      position: relative; /*相对定位*/
      width: 200px;
      height: 200px;
      border: 1px solid #ddd;
      margin: 50px;
    }
    .close-button {
      width: 30px;
      height: 30px;
      font-size: 16px;
      color: #fff;
      position: absolute; /*绝对定位*/
      /*以下三行代码，控制元素中心在扭角上*/
      right: 0;
      top: 0;
      transform: translate(50%, -50%); /*向右 向上移动自身宽高的一半*/
      display: flex; /* 弹性布局*/
      align-items: center; /*子项垂直居中*/
      justify-content: center; /*子项水平居中*/
      border-radius: 100%;
      background-color: pink;
      cursor: pointer; /*鼠标手指样式*/
    }
  </style>
  <body>
    <div class="container">
      <div class="close-button">X</div>
      ......
    </div>
  </body>